'''
Created on 27/apr/09

@author: Riccardo Cagnasso
'''

from Controller.AuthHandler import AuthHandler
from Datastore.Ticket.Ticket import Ticket
from google.appengine.api import users

class AddTicket(AuthHandler):
    def post(self):
        state = self.request.get('state')
        priority = self.request.get('priority')
        content = self.request.get('content')
        user = users.get_current_user()
        
        Ticket(
               state=state,
               priority=priority,
               content=content,
               author=user
               ).put()
        
        self.redirect("/",True)